<?php
/**
 * 商品分类验证器
 * @author maniac
 */
namespace app\common\validate;

class GoodCategory extends Base
{
    // 验证规则
    protected $rule = [
        'name' => 'require',
        'id'   => 'containSub',
    ];
    
    // 错误信息
    protected $message = [
        'name' => '请输入分类名称',
        'id'   => '请先删除分类下的商品',
    ];
    
    // 验证场景
    protected $scene = [
        'add' => ['name'],
        'del' => ['id'],
    ];
}
